home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Purity
/
Purity #23 (1994-02-10)(Diesel)(DE)[WB].zip
/
Purity #23 (1994-02-10)(Diesel)(DE)[WB].adf
/
DesignerDemo
/
menudemo
/
MenuDemo.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-01-20
|
2KB
|
60 lines
Program ButtonDemo;
Uses exec,intuition,gadtools,graphics,amiga,diskfont,
workbench,utility,menudemounit;
var
done : boolean;
class : long;
pimsg : pintuimessage;
dummy : long;
code : word;
pitem : pMenuItem;
menunumber : word;
begin
if openlibs then
begin
if makeimages then
begin
if openwindowdisplaywindow then
begin
done:=false;
repeat
dummy:=wait(bitmask(displaywindow^.userport^.mp_sigbit));
pimsg:=gt_getimsg(displaywindow^.userport);
while(pimsg<>nil) do
begin
class:=pimsg^.class;
code:=pimsg^.code;
gt_replyimsg(pimsg);
case class of
idcmp_closewindow :
done:=true;
idcmp_menupick :
begin
menunumber:=code;
while (menunumber<>menunull) and (not done) do
begin
pitem:=itemaddress(demomenu, menunumber);
if (menunum(menunumber)=demomenu_menu0) and
(itemnum(menunumber)=demomenu_menu0_item4) then
done:=true;
menunumber:=pitem^.nextselect;
end;
end;
end;
pimsg:=gt_getimsg(displaywindow^.userport);
end;
until done;
closewindowdisplaywindow;
end
else
writeln('Could not open window.');
freeimages;
end
else
writeln('Could not make images.');
closelibs;
end
else
writeln('Could not open libraries.');
end.